package com.liqi.device.service.impl;

import com.liqi.device.domain.DvDeviceModule;
import com.liqi.device.mapper.DvDeviceModuleMapper;
import com.liqi.device.service.IDvDeviceModuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 设备-模块关联Service业务层处理
 *
 * @author zhongping
 * @date 2022-02-25
 */
@Service
public class DvDeviceModuleServiceImpl implements IDvDeviceModuleService
{
    @Autowired
    private DvDeviceModuleMapper dvDeviceModuleMapper;

    /**
     * 查询设备-模块关联
     *
     * @param id 设备-模块关联主键
     * @return 设备-模块关联
     */
    @Override
    public DvDeviceModule selectDvDeviceModuleById(Long id)
    {
        return dvDeviceModuleMapper.selectDvDeviceModuleById(id);
    }

    @Override
    public List<DvDeviceModule> selectDvDeviceModuleListByDeviceCode(String deviceCode) {
        return dvDeviceModuleMapper.selectDvDeviceModuleListByDeviceCode(deviceCode);
    }

    /**
     * 查询设备-模块关联列表
     *
     * @param dvDeviceModule 设备-模块关联
     * @return 设备-模块关联
     */
    @Override
    public List<DvDeviceModule> selectDvDeviceModuleList(DvDeviceModule dvDeviceModule)
    {
        return dvDeviceModuleMapper.selectDvDeviceModuleList(dvDeviceModule);
    }

    /**
     * 新增设备-模块关联
     *
     * @param dvDeviceModule 设备-模块关联
     * @return 结果
     */
    @Override
    public int insertDvDeviceModule(DvDeviceModule dvDeviceModule)
    {
        return dvDeviceModuleMapper.insertDvDeviceModule(dvDeviceModule);
    }

    /**
     * 修改设备-模块关联
     *
     * @param dvDeviceModule 设备-模块关联
     * @return 结果
     */
    @Override
    public int updateDvDeviceModule(DvDeviceModule dvDeviceModule)
    {
        return dvDeviceModuleMapper.updateDvDeviceModule(dvDeviceModule);
    }

    @Override
    public DvDeviceModule selectDvDeviceModuleByModuleCodeAndDeviceCode(String moduleCode, String deviceCode) {
        return dvDeviceModuleMapper.selectDvDeviceModuleByModuleCodeAndDeviceCode(moduleCode, deviceCode);
    }

    /**
     * 批量删除设备-模块关联
     *
     * @param ids 需要删除的设备-模块关联主键
     * @return 结果
     */
    @Override
    public int deleteDvDeviceModuleByIds(Long[] ids)
    {
        return dvDeviceModuleMapper.deleteDvDeviceModuleByIds(ids);
    }

    /**
     * 删除设备-模块关联信息
     *
     * @param id 设备-模块关联主键
     * @return 结果
     */
    @Override
    public int deleteDvDeviceModuleById(Long id)
    {
        return dvDeviceModuleMapper.deleteDvDeviceModuleById(id);
    }

    /**
     * 查询设备-模块关联(根据moduleCode)
     *
     * @param moduleCode 模块code
     * @return 设备-模块关联
     */
    @Override
    public List<DvDeviceModule> selectDvDeviceModuleByModuleCode(String moduleCode) {
        return dvDeviceModuleMapper.selectDvDeviceModuleByModuleCode(moduleCode);
    }
}
